<?php

require_once("IDecoratedPage.php");

class Page implements IDecoratedPage{

	//Properties of the document
	public $title = "";
	public $body = "";
	public $menu = "";

	//Other properties one could ask for in such a class
	//public $m_css; //special css files only used by one controller
	//public $m_javascripts; //javascripts used
	//public $m_metaTags; //meta tags
	//public $m_redirectAdress; //dont generate output but redirect the user to this adress...
	//...

	/** Merges(adds) two Page object and returns the combined result
	 * $param Page $otherPage page to merge with
	 * @return Page
	 */
	public function Merge(Page $otherPage) {
		$ret = new Page();

		//Note $this must be used to access the member-variables of the object!!!
		$ret -> title = $this -> title . " " . $otherPage -> title;
		$ret -> body = $this -> body . "\n" . $otherPage -> body;

		return $ret;
	}

}
